<template>
  <div class="centent">
    <!-- <el-table :data="tableData" style="width: 100%; height: 300px">
      <el-table-column prop="date" label="Date" width="180" />
      <el-table-column prop="name" label="Name" width="180" />
      <el-table-column prop="address" label="Address" />
    </el-table>
    <el-carousel height="300px" direction="vertical" :autoplay="true">
      <el-carousel-item v-for="item in 4" :key="item">
        <h3 text="2xl" justify="center">{{ item }}</h3>
      </el-carousel-item>
    </el-carousel> -->
  </div>
</template>
<script setup>
import { onMounted, ref } from "vue";
const tableData = ref([
  {
    date: "2016-05-01",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-02",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-04",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-05",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-06",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-07",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-08",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-09",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-10",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-11",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-12",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-13",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
]);
onMounted(() => {
  // scroll();
});

// const scroll = () => {
//   let el = document.querySelector(".el-table__row");
//   el.addClassName = "anim";
//   setInterval(() => {
//     tableData.value.push(tableData.value[0]); // 将数组的第一个元素添加到数组的
//     tableData.value.shift(); //删除数组的第一个元素
//   }, 1000);
// };
</script>
<style lang="scss" scoped>
.anim {
  animation: mymove 1s linear;
}

@keyframes mymove {
  from {
    transform: translateY(0px);
  }
  to {
    transform: translateY(-20px);
  }
}
.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>